/*
 * This file is part of quickReminder, a software for gamers
 *
 * Copyright (C) 2006-2008 Lucas Romero
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
namespace quickReminder
{
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Resources;
    using System.Windows.Forms;

    public class FormELO : Form
    {
        private Button buttonCalc;
        private Button buttonExit;
        private Container components = null;
        private Label debug;
        private double eas;
        private double elo0;
        private double elo100;
        private double elo25;
        private double elo50;
        private double elo75;
        private Label eloDifference0;
        private Label eloDifference100;
        private Label eloDifference25;
        private Label eloDifference50;
        private Label eloDifference75;
        private int eloEnemyVar;
        private double eloNew;
        private int eloYouVar;
        private GroupBox groupBox1;
        private GroupBox groupBox2;
        private Label label1;
        private Label label14;
        private Label label15;
        private Label label16;
        private Label label2;
        private Label label3;
        private Label label4;
        private Label label5;
        private Label label6;
        private Label label7;
        private LinkLabel linkCopyright;
        private NumericUpDown numericEloEnemy;
        private NumericUpDown numericEloYou;
        private NumericUpDown numericEnemy1;
        private NumericUpDown numericEnemy2;
        private NumericUpDown numericYou1;
        private NumericUpDown numericYou2;
        private double percent;
        private double percent1;
        private double percent2;
        private Label percentRound1;
        private Label percentRound2;
        private RadioButton radioEas;
        private RadioButton radioLadder;

        public FormELO()
        {
            this.InitializeComponent();
            this.FormClosed += new FormClosedEventHandler(FormELO_FormClosed);
        }

        void FormELO_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Dispose();
        }

        private void calc(object sender, EventArgs e)
        {
            this.percentages();
            this.newEloCalc();
            this.whatIf();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void hyperlink(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("http://www.esl-europe.net/de/cs/player/419885/");
        }

        private void InitializeComponent()
        {
            ResourceManager manager = new ResourceManager(typeof(FormELO));
            this.radioEas = new RadioButton();
            this.radioLadder = new RadioButton();
            this.label1 = new Label();
            this.label2 = new Label();
            this.buttonCalc = new Button();
            this.buttonExit = new Button();
            this.label15 = new Label();
            this.debug = new Label();
            this.linkCopyright = new LinkLabel();
            this.groupBox1 = new GroupBox();
            this.eloDifference100 = new Label();
            this.label3 = new Label();
            this.label4 = new Label();
            this.label5 = new Label();
            this.label6 = new Label();
            this.label7 = new Label();
            this.eloDifference75 = new Label();
            this.eloDifference50 = new Label();
            this.eloDifference25 = new Label();
            this.eloDifference0 = new Label();
            this.groupBox2 = new GroupBox();
            this.numericYou1 = new NumericUpDown();
            this.percentRound1 = new Label();
            this.label14 = new Label();
            this.label16 = new Label();
            this.percentRound2 = new Label();
            this.numericYou2 = new NumericUpDown();
            this.numericEnemy1 = new NumericUpDown();
            this.numericEnemy2 = new NumericUpDown();
            this.numericEloYou = new NumericUpDown();
            this.numericEloEnemy = new NumericUpDown();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.numericYou1.BeginInit();
            this.numericYou2.BeginInit();
            this.numericEnemy1.BeginInit();
            this.numericEnemy2.BeginInit();
            this.numericEloYou.BeginInit();
            this.numericEloEnemy.BeginInit();
            base.SuspendLayout();
            this.radioEas.BackColor = SystemColors.Control;
            this.radioEas.Location = new Point(0x80, 0x16);
            this.radioEas.Name = "radioEas";
            this.radioEas.Size = new Size(0x5c, 0x18);
            this.radioEas.TabIndex = 3;
            this.radioEas.Text = "MR15 EAS";
            this.radioLadder.BackColor = SystemColors.Control;
            this.radioLadder.Checked = true;
            this.radioLadder.Location = new Point(0x80, 0);
            this.radioLadder.Name = "radioLadder";
            this.radioLadder.Size = new Size(0x5c, 0x18);
            this.radioLadder.TabIndex = 3;
            this.radioLadder.TabStop = true;
            this.radioLadder.Text = "MR12 Ladder";
            this.label1.BackColor = SystemColors.Control;
            this.label1.Location = new Point(6, 4);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x3a, 0x10);
            this.label1.TabIndex = 12;
            this.label1.Text = "Your ELO:";
            this.label1.TextAlign = ContentAlignment.MiddleLeft;
            this.label2.BackColor = SystemColors.Control;
            this.label2.Location = new Point(20, 0x18);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x2c, 0x10);
            this.label2.TabIndex = 13;
            this.label2.Text = "Enemy:";
            this.label2.TextAlign = ContentAlignment.MiddleLeft;
            this.buttonCalc.BackColor = SystemColors.Control;
            this.buttonCalc.DialogResult = DialogResult.None;
            this.buttonCalc.Location = new Point(140, 0xc4);
            this.buttonCalc.Name = "buttonCalc";
            this.buttonCalc.Size = new Size(80, 0x18);
            this.buttonCalc.TabIndex = 9;
            this.buttonCalc.Text = "Calculate";
            this.buttonCalc.Click += new EventHandler(this.calc);
            this.buttonExit.BackColor = SystemColors.Control;
            this.buttonExit.Location = new Point(0x34, 0xc4);
            this.buttonExit.Name = "buttonExit";
            this.buttonExit.Size = new Size(80, 0x18);
            this.buttonExit.TabIndex = 10;
            this.buttonExit.Text = "Exit";
            this.buttonExit.Click += new EventHandler(this.quit);
            this.buttonExit.DialogResult = DialogResult.OK;
            this.label15.BackColor = SystemColors.Control;
            this.label15.Font = new Font("Microsoft Sans Serif", 11f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.label15.Location = new Point(4, 0xa6);
            this.label15.Name = "label15";
            this.label15.Size = new Size(85, 20);
            this.label15.TabIndex = 8;
            this.label15.Text = "New ELO:";
            this.debug.BackColor = SystemColors.Control;
            this.debug.Font = new Font("Microsoft Sans Serif", 15f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.debug.ForeColor = Color.Navy;
            this.debug.Location = new Point(0x52, 0xa4);
            this.debug.Name = "debug";
            this.debug.Size = new Size(140, 0x1c);
            this.debug.TabIndex = 12;
            this.debug.Text = "1000 (0)";
            this.linkCopyright.BackColor = SystemColors.Control;
            this.linkCopyright.LinkColor = Color.Blue;
            this.linkCopyright.Location = new Point(0x00, 0xde);
            this.linkCopyright.Name = "linkCopyright";
            this.linkCopyright.Size = new Size(0xA0, 0x10);
            this.linkCopyright.TabIndex = 11;
            this.linkCopyright.TabStop = true;
            this.linkCopyright.Text = "ELO code contributed by mattes";
            this.linkCopyright.VisitedLinkColor = Color.Blue;
            this.linkCopyright.LinkClicked += new LinkLabelLinkClickedEventHandler(this.hyperlink);
            this.groupBox1.Controls.Add(this.eloDifference100);
            this.groupBox1.Controls.Add(this.label3);
            this.groupBox1.Controls.Add(this.label4);
            this.groupBox1.Controls.Add(this.label5);
            this.groupBox1.Controls.Add(this.label6);
            this.groupBox1.Controls.Add(this.label7);
            this.groupBox1.Controls.Add(this.eloDifference75);
            this.groupBox1.Controls.Add(this.eloDifference50);
            this.groupBox1.Controls.Add(this.eloDifference25);
            this.groupBox1.Controls.Add(this.eloDifference0);
            this.groupBox1.Location = new Point(0, 0x70);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new Size(0xe0, 50);
            this.groupBox1.TabIndex = 15;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "What-If-Machine";
            this.eloDifference100.BackColor = SystemColors.Control;
            this.eloDifference100.ForeColor = Color.Green;
            this.eloDifference100.Location = new Point(3, 0x20);
            this.eloDifference100.Name = "eloDifference100";
            this.eloDifference100.Size = new Size(0x20, 0x10);
            this.eloDifference100.TabIndex = 0x17;
            this.eloDifference100.Text = "+25";
            this.label3.BackColor = SystemColors.Control;
            this.label3.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.label3.Location = new Point(3, 0x10);
            this.label3.Name = "label3";
            this.label3.Size = new Size(40, 0x10);
            this.label3.TabIndex = 0x12;
            this.label3.Text = "100%";
            this.label4.BackColor = SystemColors.Control;
            this.label4.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.label4.Location = new Point(0x33, 0x10);
            this.label4.Name = "label4";
            this.label4.Size = new Size(40, 0x10);
            this.label4.TabIndex = 0x13;
            this.label4.Text = "75%";
            this.label5.BackColor = SystemColors.Control;
            this.label5.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.label5.Location = new Point(0x63, 0x10);
            this.label5.Name = "label5";
            this.label5.Size = new Size(40, 0x10);
            this.label5.TabIndex = 20;
            this.label5.Text = "50%";
            this.label6.BackColor = SystemColors.Control;
            this.label6.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.label6.Location = new Point(0x93, 0x10);
            this.label6.Name = "label6";
            this.label6.Size = new Size(40, 0x10);
            this.label6.TabIndex = 0x15;
            this.label6.Text = "25%";
            this.label7.BackColor = SystemColors.Control;
            this.label7.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.label7.Location = new Point(0xc3, 0x10);
            this.label7.Name = "label7";
            this.label7.Size = new Size(0x18, 0x10);
            this.label7.TabIndex = 2;
            this.label7.Text = "0%";
            this.eloDifference75.BackColor = SystemColors.Control;
            this.eloDifference75.ForeColor = Color.Green;
            this.eloDifference75.Location = new Point(0x33, 0x20);
            this.eloDifference75.Name = "eloDifference75";
            this.eloDifference75.Size = new Size(0x20, 0x10);
            this.eloDifference75.TabIndex = 0x18;
            this.eloDifference75.Text = "+12";
            this.eloDifference50.BackColor = SystemColors.Control;
            this.eloDifference50.ForeColor = Color.Yellow;
            this.eloDifference50.Location = new Point(0x63, 0x20);
            this.eloDifference50.Name = "eloDifference50";
            this.eloDifference50.Size = new Size(0x20, 0x10);
            this.eloDifference50.TabIndex = 0x19;
            this.eloDifference50.Text = "0";
            this.eloDifference25.BackColor = SystemColors.Control;
            this.eloDifference25.ForeColor = Color.Red;
            this.eloDifference25.Location = new Point(0x93, 0x20);
            this.eloDifference25.Name = "eloDifference25";
            this.eloDifference25.Size = new Size(0x20, 0x10);
            this.eloDifference25.TabIndex = 0x1a;
            this.eloDifference25.Text = "-12";
            this.eloDifference0.BackColor = SystemColors.Control;
            this.eloDifference0.ForeColor = Color.Red;
            this.eloDifference0.Location = new Point(0xc3, 0x20);
            this.eloDifference0.Name = "eloDifference0";
            this.eloDifference0.Size = new Size(0x18, 0x10);
            this.eloDifference0.TabIndex = 0x1b;
            this.eloDifference0.Text = "-25";
            this.groupBox2.BackColor = SystemColors.Control;
            this.groupBox2.Controls.Add(this.numericYou1);
            this.groupBox2.Controls.Add(this.percentRound1);
            this.groupBox2.Controls.Add(this.label14);
            this.groupBox2.Controls.Add(this.label16);
            this.groupBox2.Controls.Add(this.percentRound2);
            this.groupBox2.Controls.Add(this.numericYou2);
            this.groupBox2.Controls.Add(this.numericEnemy1);
            this.groupBox2.Controls.Add(this.numericEnemy2);
            this.groupBox2.Location = new Point(0, 0x2c);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new Size(0xe0, 0x40);
            this.groupBox2.TabIndex = 4;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Results";
            this.numericYou1.Location = new Point(70, 0x12);
            int[] bits = new int[4];
            bits[0] = 200;
            this.numericYou1.Maximum = new decimal(bits);
            this.numericYou1.Name = "numericYou1";
            this.numericYou1.Size = new Size(0x2a, 20);
            this.numericYou1.TabIndex = 5;
            this.numericYou1.GotFocus += new EventHandler(numericYou1_GotFocus);
            this.percentRound1.BackColor = SystemColors.Control;
            this.percentRound1.ForeColor = Color.Yellow;
            this.percentRound1.Location = new Point(0xa6, 20);
            this.percentRound1.Name = "percentRound1";
            this.percentRound1.Size = new Size(0x30, 0x10);
            this.percentRound1.TabIndex = 0x10;
            this.percentRound1.Text = "50%";
            this.percentRound1.TextAlign = ContentAlignment.BottomLeft;
            this.label14.BackColor = SystemColors.Control;
            this.label14.Location = new Point(0x08, 20);
            this.label14.Name = "label14";
            this.label14.Size = new Size(55, 0x10);
            this.label14.TabIndex = 14;
            this.label14.Text = "Round 1:";
            this.label14.TextAlign = ContentAlignment.MiddleLeft;
            this.label16.BackColor = SystemColors.Control;
            this.label16.Location = new Point(0x08, 0x2a);
            this.label16.Name = "label16";
            this.label16.Size = new Size(55, 0x10);
            this.label16.TabIndex = 15;
            this.label16.Text = "Round 2:";
            this.label16.TextAlign = ContentAlignment.MiddleLeft;
            this.percentRound2.BackColor = SystemColors.Control;
            this.percentRound2.ForeColor = Color.Yellow;
            this.percentRound2.Location = new Point(0xa6, 0x2a);
            this.percentRound2.Name = "percentRound2";
            this.percentRound2.Size = new Size(0x30, 0x10);
            this.percentRound2.TabIndex = 0x11;
            this.percentRound2.Text = "50%";
            this.percentRound2.TextAlign = ContentAlignment.BottomLeft;
            this.numericYou2.Location = new Point(70, 40);
            bits = new int[4];
            bits[0] = 200;
            this.numericYou2.Maximum = new decimal(bits);
            this.numericYou2.Name = "numericYou2";
            this.numericYou2.Size = new Size(0x2a, 20);
            this.numericYou2.TabIndex = 7;
            this.numericYou2.GotFocus += new EventHandler(numericYou1_GotFocus);
            this.numericEnemy1.Location = new Point(0x76, 0x12);
            bits = new int[4];
            bits[0] = 200;
            this.numericEnemy1.Maximum = new decimal(bits);
            this.numericEnemy1.Name = "numericEnemy1";
            this.numericEnemy1.Size = new Size(0x2a, 20);
            this.numericEnemy1.TabIndex = 6;
            this.numericEnemy1.GotFocus += new EventHandler(numericYou1_GotFocus);
            this.numericEnemy2.Location = new Point(0x76, 40);
            bits = new int[4];
            bits[0] = 200;
            this.numericEnemy2.Maximum = new decimal(bits);
            this.numericEnemy2.Name = "numericEnemy2";
            this.numericEnemy2.Size = new Size(0x2a, 20);
            this.numericEnemy2.TabIndex = 8;
            this.numericEnemy2.GotFocus += new EventHandler(numericYou1_GotFocus);
            this.numericEloYou.ImeMode = ImeMode.NoControl;
            this.numericEloYou.Location = new Point(0x42, 2);
            bits = new int[4];
            bits[0] = 0x1388;
            this.numericEloYou.Maximum = new decimal(bits);
            this.numericEloYou.Name = "numericEloYou";
            this.numericEloYou.Size = new Size(0x36, 20);
            this.numericEloYou.TabIndex = 1;
            bits = new int[4];
            bits[0] = 0x3e8;
            this.numericEloYou.Value = new decimal(bits);
            this.numericEloYou.GotFocus += new EventHandler(numericYou1_GotFocus);
            this.numericEloEnemy.Location = new Point(0x42, 0x18);
            bits = new int[4];
            bits[0] = 0x1388;
            this.numericEloEnemy.Maximum = new decimal(bits);
            this.numericEloEnemy.Name = "numericEloEnemy";
            this.numericEloEnemy.Size = new Size(0x36, 20);
            this.numericEloEnemy.TabIndex = 2;
            bits = new int[4];
            bits[0] = 0x3e8;
            this.numericEloEnemy.Value = new decimal(bits);
            this.numericEloEnemy.GotFocus += new EventHandler(numericYou1_GotFocus);
            this.AutoScaleBaseSize = new Size(5, 13);
            this.BackColor = SystemColors.Control;
            base.ClientSize = new Size(0xe0, 0xed);
            base.Controls.Add(this.groupBox2);
            base.Controls.Add(this.groupBox1);
            base.Controls.Add(this.linkCopyright);
            base.Controls.Add(this.debug);
            base.Controls.Add(this.label15);
            base.Controls.Add(this.buttonCalc);
            base.Controls.Add(this.label1);
            base.Controls.Add(this.radioEas);
            base.Controls.Add(this.radioLadder);
            base.Controls.Add(this.label2);
            base.Controls.Add(this.buttonExit);
            base.Controls.Add(this.numericEloYou);
            base.Controls.Add(this.numericEloEnemy);
            base.Icon = lang.kcalc16ico;
            base.MaximizeBox = false;
            base.MaximumSize = new Size(0xe8, 0x108);
            base.MinimumSize = new Size(0xe8, 0x108);
            this.StartPosition = FormStartPosition.CenterScreen;
            this.FormBorderStyle = FormBorderStyle.FixedToolWindow;
            base.Name = "Form1";
            this.Text = "EasyELO 0.1b";
            base.Load += new EventHandler(this.calc);
            this.groupBox1.ResumeLayout(false);
            this.groupBox2.ResumeLayout(false);
            this.numericYou1.EndInit();
            this.numericYou2.EndInit();
            this.numericEnemy1.EndInit();
            this.numericEnemy2.EndInit();
            this.numericEloYou.EndInit();
            this.numericEloEnemy.EndInit();
            base.ResumeLayout(false);
        }

        void numericYou1_GotFocus(object sender, EventArgs e)
        {
            NumericUpDown bla = sender as NumericUpDown;
            bla.Select(0, bla.Value.ToString().Length);
        }


        private void newEloCalc()
        {
            if (this.radioEas.Checked)
            {
                if ((this.percent1 + this.percent2) > 1)
                {
                    this.eas = 1;
                }
                else if ((this.percent1 + this.percent2) == 1)
                {
                    this.eas = 0.5;
                }
                else
                {
                    this.eas = 0;
                }
                this.eloNew = Convert.ToDouble(this.numericEloYou.Value) + (50 * (this.eas - (1 / (1 + Math.Pow(10, (-1 * (Convert.ToDouble(this.numericEloYou.Value) - Convert.ToDouble(this.numericEloEnemy.Value))) / 400)))));
            }
            else
            {
                this.eloNew = Convert.ToDouble(this.numericEloYou.Value) + (50 * (((this.percent1 + this.percent2) / 2) - (1 / (1 + Math.Pow(10, (-1 * (Convert.ToDouble(this.numericEloYou.Value) - Convert.ToDouble(this.numericEloEnemy.Value))) / 400)))));
            }
            if ((Math.Round(this.eloNew) - Convert.ToInt16(this.numericEloYou.Value)) > 0)
            {
                this.debug.Text = string.Concat(new object[] { Convert.ToString(Math.Round(this.eloNew)), " (+", Math.Round(this.eloNew) - Convert.ToInt16(this.numericEloYou.Value), ")" });
            }
            else
            {
                this.debug.Text = string.Concat(new object[] { Convert.ToString(Math.Round(this.eloNew)), " (", Math.Round(this.eloNew) - Convert.ToInt16(this.numericEloYou.Value), ")" });
            }
        }

        private void percentages()
        {
            this.eloYouVar = Convert.ToInt16(this.numericEloYou.Value);
            this.eloEnemyVar = Convert.ToInt16(this.numericEloEnemy.Value);
            if ((this.numericYou1.Value == 0M) && (this.numericEnemy1.Value == 0M))
            {
                this.percent1 = 0.5;
            }
            else
            {
                this.percent1 = Convert.ToDouble(this.numericYou1.Value) / (Convert.ToDouble(this.numericYou1.Value) + Convert.ToDouble(this.numericEnemy1.Value));
            }
            if ((this.numericYou2.Value == 0M) && (this.numericEnemy2.Value == 0M))
            {
                this.percent2 = 0.5;
            }
            else
            {
                this.percent2 = Convert.ToDouble(this.numericYou2.Value) / (Convert.ToDouble(this.numericYou2.Value) + Convert.ToDouble(this.numericEnemy2.Value));
            }
            if (((this.numericYou2.Value == 0M) && (this.numericEnemy2.Value == 0M)) && ((this.numericYou1.Value == 0M) && (this.numericEnemy1.Value == 0M)))
            {
                this.percent = 0.5;
            }
            else
            {
                this.percent = Convert.ToDouble(this.numericYou1.Value) + (Convert.ToDouble(this.numericYou2.Value) / (((Convert.ToDouble(this.numericYou1.Value) + Convert.ToDouble(this.numericYou2.Value)) + Convert.ToDouble(this.numericEnemy1.Value)) + Convert.ToDouble(this.numericEnemy2.Value)));
            }
            this.percentRound1.Text = Convert.ToString(Math.Round((double) (100 * this.percent1))) + "%";
            this.percentRound2.Text = Convert.ToString(Math.Round((double) (100 * this.percent2))) + "%";
            if (this.percent1 > 0.5)
            {
                this.percentRound1.ForeColor = Color.Green;
            }
            else if (this.percent1 == 0.5)
            {
                this.percentRound1.ForeColor = Color.Yellow;
            }
            else
            {
                this.percentRound1.ForeColor = Color.Red;
            }
            if (this.percent2 > 0.5)
            {
                this.percentRound2.ForeColor = Color.Green;
            }
            else if (this.percent2 == 0.5)
            {
                this.percentRound2.ForeColor = Color.Yellow;
            }
            else
            {
                this.percentRound2.ForeColor = Color.Red;
            }
        }

        private void quit(object sender, EventArgs e)
        {
            Close();
        }

        private void whatIf()
        {
            this.elo100 = Math.Round((double) (-1 * (Convert.ToDouble(this.numericEloYou.Value) - (Convert.ToDouble(this.numericEloYou.Value) + (50 * (1 - (1 / (1 + Math.Pow(10, (-1 * (Convert.ToDouble(this.numericEloYou.Value) - Convert.ToDouble(this.numericEloEnemy.Value))) / 400)))))))));
            this.elo75 = Math.Round((double) (-1 * (Convert.ToDouble(this.numericEloYou.Value) - (Convert.ToDouble(this.numericEloYou.Value) + (50 * (0.75 - (1 / (1 + Math.Pow(10, (-1 * (Convert.ToDouble(this.numericEloYou.Value) - Convert.ToDouble(this.numericEloEnemy.Value))) / 400)))))))));
            this.elo50 = Math.Round((double) (-1 * (Convert.ToDouble(this.numericEloYou.Value) - (Convert.ToDouble(this.numericEloYou.Value) + (50 * (0.5 - (1 / (1 + Math.Pow(10, (-1 * (Convert.ToDouble(this.numericEloYou.Value) - Convert.ToDouble(this.numericEloEnemy.Value))) / 400)))))))));
            this.elo25 = Math.Round((double) (-1 * (Convert.ToDouble(this.numericEloYou.Value) - (Convert.ToDouble(this.numericEloYou.Value) + (50 * (0.25 - (1 / (1 + Math.Pow(10, (-1 * (Convert.ToDouble(this.numericEloYou.Value) - Convert.ToDouble(this.numericEloEnemy.Value))) / 400)))))))));
            this.elo0 = Math.Round((double) (-1 * (Convert.ToDouble(this.numericEloYou.Value) - (Convert.ToDouble(this.numericEloYou.Value) + (50 * (0 - (1 / (1 + Math.Pow(10, (-1 * (Convert.ToDouble(this.numericEloYou.Value) - Convert.ToDouble(this.numericEloEnemy.Value))) / 400)))))))));
            if (this.elo100 > 0)
            {
                this.eloDifference100.ForeColor = Color.Green;
                this.eloDifference100.Text = "+" + Convert.ToString(this.elo100);
            }
            else if (this.elo100 == 0)
            {
                this.eloDifference100.ForeColor = Color.Yellow;
                this.eloDifference100.Text = Convert.ToString(this.elo100);
            }
            else
            {
                this.eloDifference100.ForeColor = Color.Red;
                this.eloDifference100.Text = Convert.ToString(this.elo100);
            }
            if (this.elo75 > 0)
            {
                this.eloDifference75.ForeColor = Color.Green;
                this.eloDifference75.Text = "+" + Convert.ToString(this.elo75);
            }
            else if (this.elo75 == 0)
            {
                this.eloDifference75.ForeColor = Color.Yellow;
                this.eloDifference75.Text = Convert.ToString(this.elo75);
            }
            else
            {
                this.eloDifference75.ForeColor = Color.Red;
                this.eloDifference75.Text = Convert.ToString(this.elo75);
            }
            if (this.elo50 > 0)
            {
                this.eloDifference50.ForeColor = Color.Green;
                this.eloDifference50.Text = "+" + Convert.ToString(this.elo50);
            }
            else if (this.elo50 == 0)
            {
                this.eloDifference50.ForeColor = Color.Yellow;
                this.eloDifference50.Text = Convert.ToString(this.elo50);
            }
            else
            {
                this.eloDifference50.ForeColor = Color.Red;
                this.eloDifference50.Text = Convert.ToString(this.elo50);
            }
            if (this.elo25 > 0)
            {
                this.eloDifference25.ForeColor = Color.Green;
                this.eloDifference25.Text = "+" + Convert.ToString(this.elo25);
            }
            else if (this.elo25 == 0)
            {
                this.eloDifference25.ForeColor = Color.Yellow;
                this.eloDifference25.Text = Convert.ToString(this.elo25);
            }
            else
            {
                this.eloDifference25.ForeColor = Color.Red;
                this.eloDifference25.Text = Convert.ToString(this.elo25);
            }
            if (this.elo0 > 0)
            {
                this.eloDifference0.ForeColor = Color.Green;
                this.eloDifference0.Text = "+" + Convert.ToString(this.elo0);
            }
            else if (this.elo0 == 0)
            {
                this.eloDifference0.ForeColor = Color.Yellow;
                this.eloDifference0.Text = Convert.ToString(this.elo0);
            }
            else
            {
                this.eloDifference0.ForeColor = Color.Red;
                this.eloDifference0.Text = Convert.ToString(this.elo0);
            }
        }
    }
}

